package com.lvmama.dashboard.rop.service.demo;

import org.springframework.stereotype.Component;

import com.lvmama.dashboard.core.annotation.AjaxMethod;
import com.lvmama.dashboard.model.rop.AjaxRequestBody;
import com.lvmama.dashboard.model.rop.AjaxResponse;
import com.lvmama.dashboard.model.rop.demo.request.DemoRequest;
import com.lvmama.dashboard.model.rop.demo.response.DemoResponse;
import com.lvmama.dashboard.service.ajax.demo.IDemoAjaxService;

@Component("demoAjaxService")
public class DemoAjaxServiceImpl implements IDemoAjaxService {

	@Override
	@AjaxMethod(ajaxmethod="com.lvtu.dashboard.demo.test")
	public AjaxResponse<DemoResponse> test(AjaxRequestBody<DemoRequest> requestBody) {
		DemoRequest demoRequest = requestBody.getT();
		System.out.println("参数：" + demoRequest.getParam1());
		System.out.println("方法：" + demoRequest.getAjaxmethod());
		AjaxResponse<DemoResponse> responseBody = new AjaxResponse<DemoResponse>();
		DemoResponse demoResponse = new DemoResponse();
		demoResponse.setParam1("param1");
		demoResponse.setParam2("param2");
		demoResponse.setParam3("param3");
		responseBody.setData(demoResponse);
		return responseBody;
	}

}
